package org.dtrd.modules.shop.service;

import org.dtrd.modules.shop.entity.bean.*;
import org.dtrd.modules.shop.entity.po.DtrdEntShcRdOrder;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

import com.baomidou.mybatisplus.core.metadata.IPage;

/**
 * <p>
 * 订单记录表服务类
 * </p>
 *
 * @author xiao
 * @since 2022-06-06
 */
public interface IDtrdEntShcRdOrderService extends IService<DtrdEntShcRdOrder> {

    List<OrderListInfo> getOrderList(OrderListRequest request);

    IPage<OrderListInfo> pageOrder(OrderPageRequest request);

    IPage<OrderListInfo> omsPageOrder(OrderOmsPageRequest request);

    OrderDetail getOrder(Integer dataId);

    boolean saveOrUpdateOrder(OrderDetail dto);

    boolean removeOrder(Integer dataId);

    /**
     * 创建服务订单
     *
     * @param patientId
     * @param serviceId
     * @param serviceSpec
     * @param orderType
     * @return
     */
    DtrdEntShcRdOrder createServiceOrder(Integer patientId, Integer serviceId, String serviceSpec, Integer orderType);

    /**
     * 查询服务订单
     *
     * @param patientId
     * @param serviceId
     * @param orderType
     * @return
     */
    DtrdEntShcRdOrder getServiceOrderByPatientIdServiceId(Integer patientId, Integer serviceId, Integer orderType);

    /**
     * 更新订单支付状态与订单状态
     *
     * @param orderDataId
     * @param userId
     * @param payStatus
     * @param orderStatus
     * @param type
     * @param transactionId
     */
    void updateOrderStatus(String orderDataId, int userId, int payStatus, int orderStatus, int type, String transactionId);

    /**
     * 完成订单
     *
     * @param orderId
     */
    boolean completeOrder(String orderId);
}
